<template>
  <div class="templateBox">
    <!-- {{ columns.length > 2  }} {{ this.data.length > 0 }} -->
    <a-table
      class="table_body"
      v-if="columns.length > 2 && this.data.length > 0"
      :scroll="{ x: 800 }"
      rowKey="index"
      :columns="columns"
      :data-source="data"
      bordered
      :pagination="false"
    >
      <!-- 序号 -->
      <span slot="serial" slot-scope="text, record, slotIndex">
        {{ slotIndex + 1 }}
      </span>

      <!-- 操作 -->
      <div v-if="isPower" slot="operation" slot-scope="text, record, slotIndex">
        <div class="iconBox" v-if="slotIndex + 1 == data.length">
          <span class="plusBox" @click.stop="plusAdd()">
            <a-icon type="plus" />
          </span>
          <a-popconfirm
            v-if="slotIndex > 0"
            class="plusBox"
            title="确定删除吗？"
            ok-text="是"
            cancel-text="否"
            @confirm="plusDel(slotIndex, record)"
          >
            <a-icon slot="icon" type="delete" />
            <a-icon type="minus" />
          </a-popconfirm>
        </div>

        <!-- & 其它环节回显的数据, 如果不是所有项都能编辑, 否则不能删除 -->
        <div v-else class="plusBox">
          <a-popconfirm title="确定删除吗？" ok-text="是" cancel-text="否" @confirm="plusDel(slotIndex, record)">
            <a-icon slot="icon" type="delete" />
            <a-icon type="minus" />
          </a-popconfirm>
        </div>
      </div>
      <!-- 所有自定义的子表单项, 作用域插槽 -->
      <div v-for="(itemSlot, index) in existingType" :key="index" :slot="itemSlot" slot-scope="text, record, slotIndex">
        <a-form-model :ref="itemSlot + record.index" :rules="rules" :model="tableMap">
          <div v-for="(item, i) in record.dataItems" :key="i">
            <!-- 输入框类型 -->
            <div
              v-if="item.slot == itemSlot && item.type == 'input'"
              @dblclick="rwoDbclick(item)"
              @mouseover="rowMouseOver(item)"
              @mouseleave="resMouseleave(item)"
            >
              <inputCol
                class="colBoxForm"
                :style="activeItem == item.pk ? 'background-color: #e6f7ff;' : ''"
                :span="item.span"
                @updatedValueF="updatedValueS"
                :prop="
                  activeList.includes(item.pk) ? (activeList.includes(item.pk) ? item.pk + record.index : null) : null
                "
                :index="slotIndex"
                @fHelp="sTriggerEvent"
                :value="tableMap[item.pk + record.index]"
                :required="item.rules[0].required"
                :options="item.options"
                :config="formJson.config"
              ></inputCol>
            </div>
            <!-- 多选类型 -->
            <div
              v-else-if="item.slot == itemSlot && item.type == 'checkbox'"
              @dblclick="rwoDbclick(item)"
              @mouseover="rowMouseOver(item)"
              @mouseleave="resMouseleave(item)"
            >
              <checkboxCol
                class="colBoxForm"
                :span="item.span"
                @updatedValueF="updatedValueS"
                :prop="activeList.includes(item.pk) ? item.pk + record.index : null"
                :index="slotIndex"
                @fHelp="sTriggerEvent"
                :value="tableMap[item.pk + record.index]"
                :required="item.rules[0].required"
                :options="item.options"
                :config="formJson.config"
              ></checkboxCol>
            </div>
            <!-- 数值类型 -->
            <div
              v-else-if="item.slot == itemSlot && item.type == 'number'"
              @dblclick="rwoDbclick(item)"
              @mouseover="rowMouseOver(item)"
              @mouseleave="resMouseleave(item)"
            >
              <numberCol
                class="colBoxForm"
                :precision="item.precision"
                :span="item.span"
                @updatedValueF="updatedValueS"
                :prop="activeList.includes(item.pk) ? item.pk + record.index : null"
                :index="slotIndex"
                @fHelp="sTriggerEvent"
                :value="tableMap[item.pk + record.index]"
                :required="item.rules[0].required"
                :options="item.options"
                :config="formJson.config"
              ></numberCol>
            </div>
            <!-- 文本域类型 -->
            <div
              v-else-if="item.slot == itemSlot && item.type == 'textarea'"
              @dblclick="rwoDbclick(item)"
              @mouseover="rowMouseOver(item)"
              @mouseleave="resMouseleave(item)"
            >
              <textareaCol
                class="colBoxForm"
                :span="item.span"
                @updatedValueF="updatedValueS"
                :prop="activeList.includes(item.pk) ? item.pk + record.index : null"
                :index="slotIndex"
                @fHelp="sTriggerEvent"
                :value="tableMap[item.pk + record.index]"
                :required="item.rules[0].required"
                :options="item.options"
                :config="formJson.config"
              ></textareaCol>
            </div>
            <!-- 单选类型 -->
            <div
              v-else-if="item.slot == itemSlot && item.type == 'radio'"
              @dblclick="rwoDbclick(item)"
              @mouseover="rowMouseOver(item)"
              @mouseleave="resMouseleave(item)"
            >
              <radioCol
                class="colBoxForm"
                :span="item.span"
                @updatedValueF="updatedValueS"
                :prop="activeList.includes(item.pk) ? item.pk + record.index : null"
                :index="slotIndex"
                @fHelp="sTriggerEvent"
                :value="tableMap[item.pk + record.index]"
                :required="item.rules[0].required"
                :options="item.options"
                :config="formJson.config"
              ></radioCol>
            </div>
            <!-- 下拉类型 -->
            <div
              v-else-if="item.slot == itemSlot && item.type == 'select'"
              @dblclick="rwoDbclick(item)"
              @mouseover="rowMouseOver(item)"
              @mouseleave="resMouseleave(item)"
            >
              <selectCol
                class="colBoxForm"
                :span="item.span"
                @updatedValueF="updatedValueS"
                :prop="activeList.includes(item.pk) ? item.pk + record.index : null"
                :index="slotIndex"
                @fHelp="sTriggerEvent"
                :value="tableMap[item.pk + record.index]"
                :required="item.rules[0].required"
                :options="item.options"
                :config="formJson.config"
              ></selectCol>
            </div>
            <div
              v-else-if="item.slot == itemSlot && item.type == 'date'"
              @dblclick="rwoDbclick(item)"
              @mouseover="rowMouseOver(item)"
              @mouseleave="resMouseleave(item)"
            >
              <datetimeCol
                class="colBoxForm"
                :span="item.span"
                @updatedValueF="updatedValueS"
                :prop="activeList.includes(item.pk) ? item.pk + record.index : null"
                :startDate="item.startDate ? item.startDate.replace('/', '-') : null"
                :endDate="item.endDate ? item.endDate.replace('/', '-') : null"
                :index="slotIndex"
                @fHelp="sTriggerEvent"
                :value="tableMap[item.pk + record.index]"
                :required="item.rules[0].required"
                :options="item.options"
                :config="formJson.config"
              ></datetimeCol>
            </div>
            <div
              v-else-if="item.slot == itemSlot && ['uploadImg', 'uploadFile'].includes(item.type)"
              @dblclick="rwoDbclick(item)"
              @mouseover="rowMouseOver(item)"
              @mouseleave="resMouseleave(item)"
            >
              <uploadCol
                class="colBoxForm"
                fileType="uploadFile"
                :span="item.span"
                @updatedValueF="updatedValueS"
                :prop="activeList.includes(item.pk) ? item.pk + record.index : null"
                :index="slotIndex"
                @fHelp="sTriggerEvent"
                :value="tableMap[item.pk + record.index]"
                :required="item.rules[0].required"
                :options="item.options"
                :config="formJson.config"
              ></uploadCol>
            </div>
            <div
              v-else-if="item.slot == itemSlot && item.type == 'time'"
              @dblclick="rwoDbclick(item)"
              @mouseover="rowMouseOver(item)"
              @mouseleave="resMouseleave(item)"
            >
              <timeCol
                class="colBoxForm"
                :span="item.span"
                @updatedValueF="updatedValueS"
                :prop="activeList.includes(item.pk) ? item.pk + record.index : null"
                :index="slotIndex"
                @fHelp="sTriggerEvent"
                :value="tableMap[item.pk + record.index]"
                :required="item.rules[0].required"
                :options="item.options"
                :config="formJson.config"
              ></timeCol>
            </div>

            <div
              v-else-if="item.slot == itemSlot && item.type == 'treeSelect'"
              @dblclick="rwoDbclick(item)"
              @mouseover="rowMouseOver(item)"
              @mouseleave="resMouseleave(item)"
            >
              <treeCol
                class="colBoxForm"
                :span="item.span"
                @updatedValueF="updatedValueS"
                :index="slotIndex"
                @fHelp="sTriggerEvent"
                :prop="activeList.includes(item.pk) ? item.pk + record.index : null"
                :required="item.rules[0].required"
                :options="item.options"
                :value="tableMap[item.pk + record.index]"
                :config="formJson.config"
              >
              </treeCol>
            </div>

            <div
              v-else-if="item.slot == itemSlot && item.type == 'cascader'"
              @dblclick="rwoDbclick(item)"
              @mouseover="rowMouseOver(item)"
              @mouseleave="resMouseleave(item)"
            >
              <cascaderCol
                class="colBoxForm"
                :span="item.span"
                @updatedValueF="updatedValueS"
                :index="slotIndex"
                @fHelp="sTriggerEvent"
                :prop="activeList.includes(item.pk) ? item.pk + record.index : null"
                :required="item.rules[0].required"
                :options="item.options"
                :value="tableMap[item.pk + record.index]"
                :config="formJson.config"
              >
              </cascaderCol>
            </div>
          </div>
        </a-form-model>
      </div>
    </a-table>
    <!-- 没数据的空白填充 -->
    <div v-else class="seat_item"></div>
  </div>
</template>
<script>
import inputCol from '@/views/FormAssembly/inputCol.vue'
import checkboxCol from '@/views/FormAssembly/checkboxCol.vue'
import numberCol from '@/views/FormAssembly/numberCol.vue'
import textareaCol from '@/views/FormAssembly/textareaCol.vue'
import radioCol from '@/views/FormAssembly/radioCol.vue'
import selectCol from '@/views/FormAssembly/selectCol.vue'
import datetimeCol from '@/views/FormAssembly/datetimeCol.vue'
import uploadCol from '@/views/FormAssembly/uploadCol.vue'
import treeCol from '@/views/FormAssembly/treeCol.vue'
import cascaderCol from '@/views/FormAssembly/cascaderCol.vue'
import timeCol from '@/views/FormAssembly/timeCol.vue'
import storage from 'store'
import { APP_USER, APP_DEPT } from '@/store/mutation-types'
import { Tp_defaultvalue } from '@/enumeration/Tp_defaultvalue.js'
import moment from 'moment'

export default {
  components: {
    inputCol,
    checkboxCol,
    numberCol,
    textareaCol,
    radioCol,
    selectCol,
    datetimeCol,
    uploadCol,
    treeCol,
    cascaderCol,
    timeCol,
  },
  props: {
    // 表格配置数据
    table_options: {
      type: Object,
      require: true,
    },
    // 表单环节配置的数据
    fieldMap: {
      type: Object,
      default: () => ({}),
    },
    // 当前环节
    nowStepid: {
      type: String,
      default: '',
    },
    title: {
      type: String,
    },
    children: {
      type: Array,
    },
    type: {
      type: String,
      default: 'table',
    },
    formJson: {
      type: Object,
      default() {
        return {}
      },
    },
    // 是否是渲染模式
    pattern: {
      type: Number,
      default: 3,
    },
    // 需要背景激活的项
    FactiveItem: {
      type: String,
      default: '',
    },
    // 需要显示的
    activeList: {
      type: Array,
      default() {
        return []
      },
    },
    // 永久隐藏的表单项
    defaultHidden: {
      type: Array,
      default() {
        return []
      },
    },
    // 操作模式下回显数据
    childrenFormData: {
      type: Object,
      default() {
        return {}
      },
    },
  },
  data() {
    return {
      tableWidth: this.table_options?.colWidth ? this.table_options.colWidth.split(",") : [], // 动态表格自定义宽度
      Tp_defaultvalue: Tp_defaultvalue, // 系统默认值枚举
      tableItem: [], // 表单添加的项
      currentUser: storage.get(APP_USER), // 登录人信息
      currentDept: storage.get(APP_DEPT), // 登录人部门
      isPower: true, // 是否具有添加和删除的权限
      tableName: '', // 子表格所用表的名称
      activeItem: '', // 背景激活的项
      tableIndex: 0, // 当前第几行
      tableMap: {}, // 存储填写的值
      data: [], //
      existingType: [], // 已配置的表格类型
      columns: [
        {
          title: '序号',
          width: '65px',
          height: '50px',
          fixed: 'left',
          align: 'center',
          scopedSlots: { customRender: 'serial' },
        },
      ], // 表格配置项
      rules: {},
    }
  },

  created() {
    // console.log('-------子表格显示', this.activeList)
    // console.log('环节配置信息(子)', this.fieldMap)
    this.formInit(this.children)
    if (this.isPower && this.pattern == 3) {
      this.columns.push({
        title: '操作',
        dataIndex: 'action',
        width: '65px',
        fixed: 'right',
        scopedSlots: { customRender: 'operation' },
      })
    }

    // & 操作模式下回显从表数据, 条件: 总的从表数据数据有当前表格的
    if (
      [3, 4].includes(this.pattern) &&
      this.tableName in this.childrenFormData
    ) {
      // console.log('子表格回显项', this.children, this.childrenFormData, this.tableName)
      // console.log('existingType', this.existingType)
      let formData = this.childrenFormData[this.tableName] || []
      formData.forEach((map, index) => {
        let primarykey = null
        this.children.forEach((item) => {
          if (item.pk in map) {
            this.tableMap[item.pk + index] = map[item.pk]
          }
          // ^ 一定要把id一定要加上去, 不然会重复保存
          if (!(this.tableName + '#id' in map)) {
            primarykey = map[this.tableName + '#id']
            this.$set(this.tableMap, this.tableName + '#id', map[this.tableName + '#id'])
          }
        })
        // 存一个主键用来删除用
        this.data.push({
          dataItems: this.children,
          index: this.tableIndex,
          primarykey: primarykey,
        })
        this.tableIndex++
      })
      // console.log('子表格回显',  this.tableMap, this.data)
    }
    // 加一个空白行
    // console.log('表格每一项', this.children)
    this.children.forEach((v) => {
      let item = {}
      for (let key in v) {
        item[key] = v[key]
      }
      this.tableItem.push(item)
    })
    // 环节配置需要出来一行, 审批端不能删除
    // 只给编辑模式加
    if(this.pattern == 1) {
      this.data.push({ dataItems: this.children, index: this.tableIndex })
    }
    
    // if ((this.isPower || this.pattern != 3) && this.data.length == 0) {
    //   this.data.push({ dataItems: this.children, index: this.tableIndex })
    // }

    // console.log('columns', this.columns)
    // console.log('表单配置项', this.columns)
    // console.log('校验规则', this.rules)
  },
  watch: {
    FactiveItem(val) {
      this.activeItem = val
    },
  },
  methods: {
    // 字段绑定模式下, 鼠标移入
    rowMouseOver(item) {
      if (this.pattern == 1) {
        // console.log('移入', item)
        this.activeItem = item.pk
        this.$listeners.rowMouseOver(item)
      }
    },
    // 字段绑定模式下, 鼠标移出
    resMouseleave(item) {
      if (this.pattern == 1) {
        this.$listeners.resMouseleave(item)
      }
    },
    // 字段绑定模式下, 双击添加
    rwoDbclick(item) {
      if (this.pattern == 1) {
        console.log('子添加', item)
        this.$listeners.rowDbclick(item)
      }
    },
    // 代替子函数触发事件
    sTriggerEvent(functionString, index) {
      // 代理字符串的this到我们备份到this的对象上
      functionString = functionString.replace(/this\[/g, 'this.tableMap[')
      functionString = functionString.replace(/\]/g, `+${index}]`)
      eval(functionString)
      console.log('代替触发son', functionString, this.tableMap)
    },
    // 校验表格数据
    validateF() {
      let state = true // 校验通过状态
      for (let key in this.$refs) {
        this.$refs[key].forEach((v) => {
          v.validate((valid) => {
            if (!valid) {
              state = false
            }
          })
        })
      }
      // 把值给父组件
      console.log('把值给父组件', state)
      // console.log(' this.$listeners',  this.$listeners)
      console.log('子表格数据', this.tableMap)
      this.$listeners.fSetFormData(this.tableMap)
      return state
    },
    // 减去表格项
    async plusDel(index, record) {
      // console.log('record', record, record.primarykey)
      // 调用接口删除业务表数据
      if (record.primarykey) {
        const res = await formRemoveById(this.tableName, record.primarykey)
        console.log('删除业务表', res)
      }
      let delItem = this.data.splice(index, 1)
      console.log('删除', index, record.index)
      // this.tableIndex
      delItem[0].dataItems.forEach((v) => {
        if (v.pk + record.index in this.tableMap) {
          delete this.tableMap[v.pk + record.index]
        }
      })
      // console.log('对象数据-', this.tableMap)
    },
    // 添加项
    plusAdd() {
      // console.log('新加项', addItem)
      // console.log('新校验规则', this.rules)
      if (this.tableItem.length == 0) {
        return
      }

      let addItem = []
      this.tableItem.forEach((v) => {
        let item = {}
        for (let key in v) {
          item[key] = v[key]
        }
        addItem.push(item)
      })
      this.tableIndex++
      addItem.forEach((v) => {
        if (
          v.pk in this.fieldMap &&
          this.fieldMap[v.pk].stepid_ === this.nowStepid
        ) {
          // 系统默认值
          if (this.fieldMap[v.pk].value_ in Tp_defaultvalue) {
            this.$set(
              this.tableMap,
              v.pk + this.tableIndex,
              this.getSystemValue(this.fieldMap[v.pk].value_)
            )
            // console.log('返回值',this.tableMap[v.pk + this.tableIndex], this.fieldMap[v.pk].value_, )
          } else if (this.fieldMap[v.pk].value_.indexOf('$string') > -1) {
            this.$set(
              this.tableMap,
              v.pk + this.tableIndex,
              this.fieldMap[v.pk].value_.substring(
                this.fieldMap[v.pk].value_.indexOf('.') + 1,
                this.fieldMap[v.pk].value_.length
              )
            )
          } else {
            this.$set(
              this.tableMap,
              v.pk + this.tableIndex,
              this.fieldMap[v.pk].value_
            )
          }
        } else if (v.options.defaultValue) {
          this.$set(this.tableMap, v.pk + this.tableIndex, v.options.defaultValue)
        }
        this.addRule(v)
      })

      this.data.push({ dataItems: addItem, index: this.tableIndex })

      // console.log('对象数据+', this.tableMap)
    },
    // 获取系统配置表达式的默认值
    getSystemValue(value) {
      switch (value) {
        case '$user.fullname':
          return this.currentUser.fullname
        case '$user.id':
          return this.currentUser.userId
        case '$user.username':
          return this.currentUser.username
        case '$dept.id':
          return this.currentDept.id
        case '$dept.name':
          return this.currentDept.name
        case '$dept.sectionid':
          return this.currentDept.sectionid
        case '$dept.sectionname':
          return this.currentDept.sectionname
        case '$dept.adid':
          return this.currentUser.adid
        case '$now.date':
          return this.$moment().format('YYYY-MM-DD HH:mm:ss')
        case '$now.datetime':
          return this.$moment().format()
        case '$now.time':
          return this.$moment().format('HH:mm:ss')
        default:
          this.$message.error('未知的表达式' + value)
      }
    },
    // 子组件更新父组件数据
    updatedValueS(id, value, index) {
      console.log('子表单更新值', id, value, index, this.tableMap)
      this.tableMap[id] = value
    },
    // 计算动态表格宽度
    getTableWidth(v) {
      // console.log('计算动态表格宽度', v, this.tableWidth)
      // 隐藏的给个100%, 里面控件没内容不会显示出来
      if(v.options.hidden == true) {
        return '100%'
      } else if(this.tableWidth.length > 0) {
        // 没隐藏的根据 tableWidth 按顺序给
        let width = this.tableWidth[0]
        this.tableWidth.splice(0, 1)
        return width
      } else {
        return '100%'
      }
    },
    // 初始化表格数据
    formInit(data) {
      data &&
        data.forEach((v, i) => {
          // & 取和校验表名 (一个子表格只能绑定一张表)
          if (this.tableName == '' && v.pk) {
            this.tableName = v.pk.substring(0, v.pk.indexOf('#'))
            // console.log('所用表1', this.tableName)
          } else {
            if (this.tableName != v.pk.substring(0, v.pk.indexOf('#'))) {
              console.error(`字段${v.pk}和表${this.tableName}不一致`)
            }
          }
          // 因为只有一行, 每一项都是唯一的, 所有即便类型相同, slot也要不同才能显示
          let slot = v.type + i
          this.existingType.push(slot)
          v.slot = slot
          // 添加v-model的值对象
          // 没有配置过的新类型继续配, 已配置的不用配了
          // console.log('子表格->', v)
          let item = {
            title: v.label,
            width: this.getTableWidth(v),
            align: 'left',
            scopedSlots: { customRender: slot },
          }
          // 给默认值 this.fieldMap
          // console.log('给默认值', v, v.pk in this.fieldMap, this.fieldMap[v.pk], this.nowStepid)
          if (
            v.pk in this.fieldMap && this.fieldMap[v.pk].value_ && 
            this.fieldMap[v.pk].stepid_ === this.nowStepid
          ) {
            // 系统默认值
            const variable = this.fieldMap[v.pk].value_.replace(
              /(^\s*)|(\s*$)/g,
              ''
            )
            if (variable in Tp_defaultvalue) {
              this.$set(
                this.tableMap,
                v.pk + this.tableIndex,
                this.getSystemValue(variable)
              )
              // console.log('返回值',this.tableMap[v.pk + this.tableIndex], this.fieldMap[v.pk].value_, )
            } else {
              this.$set(this.tableMap, v.pk + this.tableIndex, variable)
            }
          } else if (v.options.defaultValue) {
              this.$set(this.tableMap, v.pk + this.tableIndex, v.options.defaultValue)
            
          } else {
            this.$set(this.tableMap, v.pk + this.tableIndex, null)
          }

          // - 编辑模式下对象存值
          if (this.pattern == 2) {
            // - 渲染模式下 - 默认描述
            v.options.explain = this.getDefaultValue(v.type)
            // 控制是否编辑
            v.options.disabled = this.activeList.includes(v.pk) ? false : true
            // 控制是否显示表格项
            if (
              v.options.hidden != true &&
              this.defaultHidden.includes(v.pk) == false
            ) {
              this.columns.push(item)
            }
          } else if (this.pattern == 1) {
            // - 控制可不可编辑
            v.options.disabled = true
            if (
              v.options.hidden != true &&
              this.defaultHidden.includes(v.pk) == false
            ) {
              this.columns.push(item)
            }
          } else if ([3, 4].includes(this.pattern)) {
            // 控制是否编辑
            // console.log('控制是否编辑', this.activeList, v.pk)
            v.options.disabled = this.activeList.includes(v.pk) ? false : true
            // 永久隐藏
            // console.log('永久隐藏', v.label, v.options.hidden, v.pk, this.defaultHidden)
            if (
              v.options.hidden != true &&
              this.defaultHidden.includes(v.pk) == false
            ) {
              this.columns.push(item)
            }
          }
          // console.log('子表格', v.label, v)
          // 配置校验规则
          this.addRule(v)
        })
      for (let v of data) {
        if (this.pattern == 3 && v.options.hidden == false) {
          this.isPower = !v.options.disabled
          // console.log('是否有操作权限', this.isPower)
          return
        }
      }
    },
    // 控件类型描述
    getDefaultValue(type) {
      switch (type) {
        case 'text': {
          return '表单标题'
        }
        case 'input': {
          return '文本输入框'
        }
        case 'radio': {
          return '单选框'
        }
        case 'number': {
          return '数字输入框'
        }
        case 'checkbox': {
          return '多选框'
        }
        case 'textarea': {
          return '文本域'
        }
        case 'numradiober': {
          return '单选框'
        }
        case 'select': {
          return '下拉选择器'
        }
        case 'date': {
          return '日期选择器'
        }
        case 'uploadImg': {
          return '图片上传'
        }
        case 'uploadFile': {
          return '文件上传'
        }
        case 'treeSelect': {
          return '树形选择器'
        }
        case 'cascader': {
          return '级联选择器'
        }
        case 'time': {
          return '时间选择器'
        }
        default: {
          return '表单控件'
        }
      }
    },
    // 配置校验规则
    addRule(value) {
      if (value.type == 'text') {
        return
      }  else {
        let tempruleList = []
        value.rules.forEach((v) => {
          if (value.type == 'select' && value.options.multiple) {
            v.trigger = 'array'
          } else {
            v.trigger = 'change'
          }
          tempruleList.push(v)
        })
        this.rules[value.pk + this.tableIndex] = tempruleList
      }
    },
  },
}
</script>

<style lang="less" scoped>
.seat_item {
  height: 25px;
}
.iconBox {
  // border: 1px solid red;
  margin-left: 10px;
}
.table_body {
  background-color: #fff;
}
.checkBox {
  background-color: #e6f7ff;
}
.colBoxForm {
  margin-top: 0px;
  // border: 1px solid blue;
  max-height: 20px;
}
.plusBox {
  margin: -0px -30px 0 -0px;
  cursor: pointer;
  color: #1e90ff;
}
.titleBox {
  text-align: left;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  font-family: STXinwei;
}
.templateBox {
  z-index: -100;
  background-color: #fff;
}
/deep/ .ant-table-pagination.ant-pagination {
  display: none;
}
/deep/ .ant-table-tbody > tr > td {
  // 修改item高度
  padding: 0px 16px !important;
}
</style>
